

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Dragonborn-zz">
  <meta name="keywords" content="">
  
    <meta name="description" content="# 1. 引入 java 项目引入 12345&lt;dependency&gt;	&lt;groupId&gt;org.projectlombok&lt;&#x2F;groupId&gt;    &lt;artifactId&gt;lombok&lt;&#x2F;artifactId&gt;    &lt;version&gt;1.18.24&lt;&#x2F;version&gt; &lt;!-- Spring Boot">
<meta property="og:type" content="article">
<meta property="og:title" content="lombok的使用">
<meta property="og:url" content="http://example.com/2024/02/18/java/lombok%E7%9A%84%E4%BD%BF%E7%94%A8/index.html">
<meta property="og:site_name" content="Dragonborn-zz&#39;s个人博客">
<meta property="og:description" content="# 1. 引入 java 项目引入 12345&lt;dependency&gt;	&lt;groupId&gt;org.projectlombok&lt;&#x2F;groupId&gt;    &lt;artifactId&gt;lombok&lt;&#x2F;artifactId&gt;    &lt;version&gt;1.18.24&lt;&#x2F;version&gt; &lt;!-- Spring Boot">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2024-02-18T03:28:48.555Z">
<meta property="article:modified_time" content="2024-02-18T03:28:48.555Z">
<meta property="article:author" content="Dragonborn-zz">
<meta property="article:tag" content="lombok">
<meta property="article:tag" content="java">
<meta name="twitter:card" content="summary_large_image">
  
  
  
  <title>lombok的使用 - Dragonborn-zz&#39;s个人博客</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.7","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"left","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml","include_content_in_search":true};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Dragonborn-zz</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/" target="_self">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/" target="_self">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/" target="_self">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/" target="_self">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="https://gitee.com/dragonborn-zz" target="_self">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/home.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="lombok的使用"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2024-02-18 03:28" pubdate>
          2024年2月18日 凌晨
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          928 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          8 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <h1 id="seo-header">lombok的使用</h1>
            
            
              <div class="markdown-body">
                
                <h2 id="1-引入"><a class="markdownIt-Anchor" href="#1-引入">#</a> 1. 引入</h2>
<p>java 项目引入</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.projectlombok<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>lombok<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.18.24<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span> <span class="hljs-comment">&lt;!-- Spring Boot 项目此部分可以不写 --&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><br></code></pre></td></tr></table></figure>
<p>Android 项目引入</p>
<figure class="highlight clean"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs clean"><span class="hljs-keyword">implementation</span> <span class="hljs-string">&quot;org.projectlombok:lombok:1.18.24&quot;</span><br>annotationProcessor <span class="hljs-string">&quot;org.projectlombok:lombok:1.18.24&quot;</span><br></code></pre></td></tr></table></figure>
<h2 id="2-配置文件"><a class="markdownIt-Anchor" href="#2-配置文件">#</a> 2. 配置文件</h2>
<p>lombok 的配置文件名为 lombok.config, 生效的作用域为其所在的目录和其子目录</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs lombok.config">#指明lombok的根目录为当前配置文件所在目录<br>config.stopBubbling=true<br># 解决子类对象属性值一致，但其继承的父类对象属性值不一致，在比较的时候会出现比较结果不对的情况<br>lombok.equalsAndHashCode.callSuper=call<br># 使子类的toString方法包括其继承的父类对象属性值<br>lombok.toString.callSuper = call<br>#生成的set方法返回由null改为this,可以链式调用<br>#lombok.accessors.chain=true<br></code></pre></td></tr></table></figure>
<h2 id="3-注解"><a class="markdownIt-Anchor" href="#3-注解">#</a> 3. 注解</h2>
<table>
<thead>
<tr>
<th style="text-align:left">注解</th>
<th style="text-align:right">使用位置</th>
<th style="text-align:center">使用效果</th>
<th style="text-align:center">注解属性</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">@Data</td>
<td style="text-align:right">类</td>
<td style="text-align:center">为类的字段生成 get,set 方法，重写类的 equals,toString 和 hashCode 方法</td>
</tr>
<tr>
<td style="text-align:left">@Value</td>
<td style="text-align:right">字段，类</td>
<td style="text-align:center">效果相当于 java17 的 record 类</td>
</tr>
<tr>
<td style="text-align:left">@Getter</td>
<td style="text-align:right">字段，类</td>
<td style="text-align:center">为类的字段生成 get 方法</td>
</tr>
<tr>
<td style="text-align:left">@Setter</td>
<td style="text-align:right">字段，类</td>
<td style="text-align:center">为类的字段生成 set 方法</td>
</tr>
<tr>
<td style="text-align:left">@EqualsAndHashCode</td>
<td style="text-align:right">类</td>
<td style="text-align:center">重写类的 equals 和 hashCode 方法</td>
</tr>
<tr>
<td style="text-align:left">@ToString</td>
<td style="text-align:right">类</td>
<td style="text-align:center">重写类的 toString 方法</td>
</tr>
<tr>
<td style="text-align:left">@AllArgsConstructor</td>
<td style="text-align:right">类</td>
<td style="text-align:center">为类全参构造函数</td>
</tr>
<tr>
<td style="text-align:left">@NoArgsConstructor</td>
<td style="text-align:right">类</td>
<td style="text-align:center">为类生成无参构造函数</td>
</tr>
<tr>
<td style="text-align:left">@RequiredArgsConstructor</td>
<td style="text-align:right">类</td>
<td style="text-align:center">为类生成有参构造函数</td>
</tr>
<tr>
<td style="text-align:left">@Builder</td>
<td style="text-align:right">类</td>
<td style="text-align:center">自动生成构造者模式代码</td>
</tr>
<tr>
<td style="text-align:left">@val</td>
<td style="text-align:right">常量声明</td>
<td style="text-align:center">根据赋值推断出常量类型</td>
</tr>
<tr>
<td style="text-align:left">@var</td>
<td style="text-align:right">变量声明</td>
<td style="text-align:center">根据赋值推断出常量类型 (等效 java11 的 var 关键字)</td>
</tr>
<tr>
<td style="text-align:left">@With</td>
<td style="text-align:right">字段，类</td>
<td style="text-align:center">作用于类、变量，生成 with + 变量名的方法，返回当前对象</td>
</tr>
<tr>
<td style="text-align:left">@CustomLog</td>
<td style="text-align:right">类</td>
<td style="text-align:center">自定义日志类，生成 log 对象</td>
</tr>
<tr>
<td style="text-align:left">@NonNull</td>
<td style="text-align:right"></td>
<td style="text-align:center">作用于成员变量和参数中，标识不能为空，否则抛出空指针异常</td>
</tr>
<tr>
<td style="text-align:left">@Generated</td>
<td style="text-align:right"></td>
<td style="text-align:center">用于标记类、变量、方法是自动生成的，没什么大用</td>
</tr>
<tr>
<td style="text-align:left">@Cleanup</td>
<td style="text-align:right">变量</td>
<td style="text-align:center">自动关闭资源，针对实现了 java.io.Closeable 接口的对象有效</td>
</tr>
<tr>
<td style="text-align:left">@Synchronized</td>
<td style="text-align:right">方法</td>
<td style="text-align:center">作用于方法，可以替换 synchronized 关键字或 lock 锁</td>
</tr>
<tr>
<td style="text-align:left">@SneakyThrows</td>
<td style="text-align:right">方法</td>
<td style="text-align:center">作用于方法，对异常进行捕捉并抛出</td>
</tr>
<tr>
<td style="text-align:left">@Singular</td>
<td style="text-align:right">集合字段</td>
<td style="text-align:center">作用于集合字段，需要配合 @Builder 使用，加入了 @Singular 注解后，lombok 为我们添加了一个为集合添加元素的方法</td>
</tr>
</tbody>
</table>
<p>@CommonsLog，@Log，@JBossLog，@Log4j，@Log4j2，@Slf4j，@XSlf4j：日志注解，作用于类</p>
<h2 id="4-实验性注解的使用"><a class="markdownIt-Anchor" href="#4-实验性注解的使用">#</a> 4. 实验性注解的使用</h2>
<p>@Accessors：类似于 @Builder 支持链式调用，需要配合 @Setter、@Getter 等注解使用，作用于类、变量<br>
 @Delegate：作用于容器变量，为该变量生成一堆常用的方法，这些方法都是容器中的方法<br>
 @ExtensionMethod：作用于类，向类添加方法，无需创建新的子类<br>
 @FieldDefaults：作用于类，定义变量的访问修饰符以及是否加 final<br>
@FieldNameConstants：作用于类，生成一个包含所有成员变量的内部类或者内部枚举，内部类中每个字段值即为字段名并且值不可变<br>
 @Helper：作用于方法内部类，使内部类中的方法暴露在外面可以被直接调用，不建议使用<br>
 @NonFinal：作用于类、变量，表示变量不加 final<br>
@PackagePrivate：作用于类和变量，相当于访问修饰符的 default，没什么用<br>
 @SuperBuilder：支持对于基类成员变量赋值，算是 @Builder 的升级版<br>
 @Tolerate：实现对冲突的兼容，作用于方法上，没什么大用，可以配合 @Builder 使用<br>
 @UtilityClass：作用于类，将类标记为 final，并且类、内部类中的方法、字段都标记为 static<br>
@WithBy3<br>
 六、基于 v1.18.22 版本的实验性注解<br>
 @StandardException：自定义异常类</p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/java/" class="category-chain-item">java</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/lombok/" class="print-no-link">#lombok</a>
      
        <a href="/tags/java/" class="print-no-link">#java</a>
      
    </div>
  
</div>


              

              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2024/02/18/java/Mybatis%E4%B8%80%E7%BA%A7%E7%BC%93%E5%AD%98%E5%92%8C%E4%BA%8C%E7%BA%A7%E7%BC%93%E5%AD%98%E5%8E%9F%E7%90%86%E5%8C%BA%E5%88%AB/" title="Mybatis一级缓存和二级缓存原理区别">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Mybatis一级缓存和二级缓存原理区别</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2024/02/18/java/springboot%E9%A1%B9%E7%9B%AE%E6%B5%8B%E8%AF%95%E6%A1%86%E6%9E%B6spock/" title="springboot项目测试框架spock">
                        <span class="hidden-mobile">springboot项目测试框架spock</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
    <!-- 备案信息 ICP for China -->
    <div class="beian">
  <span>
    <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
      皖ICP备2023001508号
    </a>
  </span>
  
</div>

  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.4/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.20.1/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
